//
//  TheContactViewController.m
//  WE
//
//  Created by 要帅气的生活 on 15/12/2.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "TheContactViewController.h"
#import "Size.h"
#import "AddTheContactViewController.h"
#import <Masonry.h>
@interface TheContactViewController ()

@property (nonatomic,strong) NSMutableArray *arrayTheContact;

@end

@implementation TheContactViewController
- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden = NO;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"家庭联系人";
    UIBarButtonItem *right = [[UIBarButtonItem alloc] initWithTitle:@"添加" style:UIBarButtonItemStyleDone target:self action:@selector(add)];
    self.navigationItem.rightBarButtonItem = right;
    _arrayTheContact = [NSMutableArray array];
    [self theContact];
}
-(void)add{
    AddTheContactViewController *addthe = [AddTheContactViewController new];
    addthe.view.backgroundColor = [UIColor whiteColor];
    [self.navigationController pushViewController:addthe animated:YES];
}

-(void)theContact
{
    if (_arrayTheContact == nil || _arrayTheContact.count == 0) {
        
        UIView *wu = [[UIView alloc] initWithFrame:CGRectMake(0, 64, WindowWidth, WindowHeight)];
        [self.view addSubview:wu];
        wu.backgroundColor = GRAYCOLOR;
        
        UIView *zho = [[UIView alloc] init];
        [wu addSubview:zho];
        zho.backgroundColor = [UIColor clearColor];
        [zho mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(wu.mas_top).with.offset(100);
            make.left.equalTo(wu.mas_left).with.offset(35);
            make.right.equalTo(wu.mas_right).with.offset(-35);
            make.height.offset(180);
        }];
        
        UIImageView *imageview = [[UIImageView alloc] init];
        [zho addSubview:imageview];
        imageview.image = [UIImage imageNamed:@"jinggao"];
        //imageview.backgroundColor = [UIColor redColor];
        [imageview mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(zho.mas_top).with.offset(5);
            make.left.equalTo(zho.mas_left).with.offset(260/2*Width);
            //make.right.equalTo(zho.mas_right).with.offset(-35);
            make.height.offset(45);
            make.width.offset(45);
        }];
        
        UILabel *labelshang = [UILabel new];
        [zho addSubview:labelshang];
        [labelshang mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(zho.mas_top).with.offset(60);
            make.left.equalTo(zho.mas_left).with.offset(5);
            make.right.equalTo(zho.mas_right).with.offset(-5);
            make.height.offset(25);
        }];
        labelshang.text = @"您还没有添加任何家庭联系人";
        labelshang.font = [UIFont systemFontOfSize:17];
        labelshang.textAlignment = 1;
        
        UILabel *labelzho= [UILabel new];
        [zho addSubview:labelzho];
        [labelzho mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(zho.mas_top).with.offset(95);
            make.centerX.equalTo(zho);
            make.height.offset(25);
        }];
        labelzho.text = @"您可以将家人添加为家庭联系人";
        labelzho.font = [UIFont systemFontOfSize:14];
        labelzho.textAlignment = 1;
        labelzho.alpha = 0.5;
        UILabel *labelxia= [UILabel new];
        [zho addSubview:labelxia];
        [labelxia mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(zho.mas_top).with.offset(122);
            make.centerX.equalTo(zho);
            make.height.offset(25);
        }];
        labelxia.text = @"为他们预约挂号，咨询专家，管理他们的病历";
        labelxia.font = [UIFont systemFontOfSize:14];
        labelxia.textAlignment = 1;
        labelxia.alpha = 0.5;
    }else{
        
    }
}

@end
